package com.primestone.cim.client.business;


/**
 * 
 * @author cesar.mateus
 * Jul 3, 2013 7:08:02 PM
 * CSVBean.java
 * CIMClientApplication
 *
 */
public class CSVBean {
	
	private String ticket;
	private String idBlock;
	private Boolean isLastBlock;
	private String oldBlock;
	private String idDevice;
	private String idSocket;
	private String varType;
	private String descvar;
	
	private Boolean intervalBlock;
	private String timestamp;
	private String value;
	private String readingType;
	
	private static final String COMMA = ",";
	
	/**
	 * @param ticket
	 * @param idBlock
	 * @param isLastBlock
	 * @param oldBlock
	 * @param idDevice
	 * @param idSocket
	 * @param varType
	 * @param descvar
	 * @param intervalBlock
	 * @param timestamp
	 * @param value
	 * @param readingType
	 */
	public CSVBean(String ticket, String idBlock, Boolean isLastBlock,
			String oldBlock, String idDevice, String idSocket, String varType,
			String descvar, Boolean intervalBlock, String timestamp,
			String value, String readingType) {
		super();
		this.ticket = ticket;
		this.idBlock = idBlock;
		this.isLastBlock = isLastBlock;
		this.oldBlock = oldBlock;
		this.idDevice = idDevice;
		this.idSocket = idSocket;
		this.varType = varType;
		this.descvar = descvar;
		this.intervalBlock = intervalBlock;
		this.timestamp = timestamp;
		this.value = value;
		this.readingType = readingType;
	}
	
	public String getConcat() {
		return new StringBuilder(ticket).append(COMMA)
				.append(idBlock).append(COMMA)
				.append(isLastBlock).append(COMMA)
				.append(oldBlock).append(COMMA)
				.append(idDevice).append(COMMA)
				.append(idSocket).append(COMMA)
				.append(varType).append(COMMA)
				.append(descvar).append(COMMA)
				.append(intervalBlock).append(COMMA)
				.append(timestamp).append(COMMA)
				.append(value).append(COMMA)
				.append(readingType).append(COMMA)
				.toString();
	}
	
	/**
	 * @return the ticket
	 */
	public String getTicket() {
		return this.ticket;
	}
	/**
	 * @param ticket the ticket to set
	 */
	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	/**
	 * @return the idBlock
	 */
	public String getIdBlock() {
		return this.idBlock;
	}
	/**
	 * @param idBlock the idBlock to set
	 */
	public void setIdBlock(String idBlock) {
		this.idBlock = idBlock;
	}
	/**
	 * @return the isLastBlock
	 */
	public Boolean getIsLastBlock() {
		return this.isLastBlock;
	}
	/**
	 * @param isLastBlock the isLastBlock to set
	 */
	public void setIsLastBlock(Boolean isLastBlock) {
		this.isLastBlock = isLastBlock;
	}
	/**
	 * @return the oldBlock
	 */
	public String getOldBlock() {
		return this.oldBlock;
	}
	/**
	 * @param oldBlock the oldBlock to set
	 */
	public void setOldBlock(String oldBlock) {
		this.oldBlock = oldBlock;
	}
	/**
	 * @return the idDevice
	 */
	public String getIdDevice() {
		return this.idDevice;
	}
	/**
	 * @param idDevice the idDevice to set
	 */
	public void setIdDevice(String idDevice) {
		this.idDevice = idDevice;
	}
	/**
	 * @return the idSocket
	 */
	public String getIdSocket() {
		return this.idSocket;
	}
	/**
	 * @param idSocket the idSocket to set
	 */
	public void setIdSocket(String idSocket) {
		this.idSocket = idSocket;
	}
	/**
	 * @return the varType
	 */
	public String getVarType() {
		return this.varType;
	}
	/**
	 * @param varType the varType to set
	 */
	public void setVarType(String varType) {
		this.varType = varType;
	}
	/**
	 * @return the descvar
	 */
	public String getDescvar() {
		return this.descvar;
	}
	/**
	 * @param descvar the descvar to set
	 */
	public void setDescvar(String descvar) {
		this.descvar = descvar;
	}
	/**
	 * @return the intervalBlock
	 */
	public Boolean getIntervalBlock() {
		return this.intervalBlock;
	}
	/**
	 * @param intervalBlock the intervalBlock to set
	 */
	public void setIntervalBlock(Boolean intervalBlock) {
		this.intervalBlock = intervalBlock;
	}
	/**
	 * @return the timestamp
	 */
	public String getTimestamp() {
		return this.timestamp;
	}
	/**
	 * @param timestamp the timestamp to set
	 */
	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}
	/**
	 * @return the value
	 */
	public String getValue() {
		return this.value;
	}
	/**
	 * @param value the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}
	/**
	 * @return the readingType
	 */
	public String getReadingType() {
		return this.readingType;
	}
	/**
	 * @param readingType the readingType to set
	 */
	public void setReadingType(String readingType) {
		this.readingType = readingType;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.descvar == null) ? 0 : this.descvar.hashCode());
		result = prime * result
				+ ((this.idBlock == null) ? 0 : this.idBlock.hashCode());
		result = prime * result
				+ ((this.idDevice == null) ? 0 : this.idDevice.hashCode());
		result = prime * result
				+ ((this.idSocket == null) ? 0 : this.idSocket.hashCode());
		result = prime
				* result
				+ ((this.intervalBlock == null) ? 0 : this.intervalBlock
						.hashCode());
		result = prime
				* result
				+ ((this.isLastBlock == null) ? 0 : this.isLastBlock.hashCode());
		result = prime * result
				+ ((this.oldBlock == null) ? 0 : this.oldBlock.hashCode());
		result = prime
				* result
				+ ((this.readingType == null) ? 0 : this.readingType.hashCode());
		result = prime * result
				+ ((this.ticket == null) ? 0 : this.ticket.hashCode());
		result = prime * result
				+ ((this.timestamp == null) ? 0 : this.timestamp.hashCode());
		result = prime * result
				+ ((this.value == null) ? 0 : this.value.hashCode());
		result = prime * result
				+ ((this.varType == null) ? 0 : this.varType.hashCode());
		return result;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CSVBean other = (CSVBean) obj;
		if (this.descvar == null) {
			if (other.descvar != null)
				return false;
		} else if (!this.descvar.equals(other.descvar))
			return false;
		if (this.idBlock == null) {
			if (other.idBlock != null)
				return false;
		} else if (!this.idBlock.equals(other.idBlock))
			return false;
		if (this.idDevice == null) {
			if (other.idDevice != null)
				return false;
		} else if (!this.idDevice.equals(other.idDevice))
			return false;
		if (this.idSocket == null) {
			if (other.idSocket != null)
				return false;
		} else if (!this.idSocket.equals(other.idSocket))
			return false;
		if (this.intervalBlock == null) {
			if (other.intervalBlock != null)
				return false;
		} else if (!this.intervalBlock.equals(other.intervalBlock))
			return false;
		if (this.isLastBlock == null) {
			if (other.isLastBlock != null)
				return false;
		} else if (!this.isLastBlock.equals(other.isLastBlock))
			return false;
		if (this.oldBlock == null) {
			if (other.oldBlock != null)
				return false;
		} else if (!this.oldBlock.equals(other.oldBlock))
			return false;
		if (this.readingType == null) {
			if (other.readingType != null)
				return false;
		} else if (!this.readingType.equals(other.readingType))
			return false;
		if (this.ticket == null) {
			if (other.ticket != null)
				return false;
		} else if (!this.ticket.equals(other.ticket))
			return false;
		if (this.timestamp == null) {
			if (other.timestamp != null)
				return false;
		} else if (!this.timestamp.equals(other.timestamp))
			return false;
		if (this.value == null) {
			if (other.value != null)
				return false;
		} else if (!this.value.equals(other.value))
			return false;
		if (this.varType == null) {
			if (other.varType != null)
				return false;
		} else if (!this.varType.equals(other.varType))
			return false;
		return true;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return String
				.format("CSVBean [ticket=%s, idBlock=%s, isLastBlock=%s, oldBlock=%s, idDevice=%s, idSocket=%s, varType=%s, descvar=%s, intervalBlock=%s, timestamp=%s, value=%s, readingType=%s]",
						this.ticket, this.idBlock, this.isLastBlock,
						this.oldBlock, this.idDevice, this.idSocket,
						this.varType, this.descvar, this.intervalBlock,
						this.timestamp, this.value, this.readingType);
	}
	
		
}
